﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Bullet : MonoBehaviour
{
    //移动速度
    public float moveSpeed = 20;
    void Start()
    {
        //播放音效
        if (MusicData.soundOn)
        {
            AudioSource audioSource = this.gameObject.AddComponent<AudioSource>();
            audioSource.clip = Resources.Load<AudioClip>("Sound/LaserShoot");
            audioSource.volume = MusicData.volume;
            audioSource.Play();
        }
        Destroy(this.gameObject, 3);
    }

    // Update is called once per frame
    void Update()
    {
        this.transform.Translate(moveSpeed * Vector3.forward * Time.deltaTime);
    }
}
